package com.example.bootdemo.rocketmq.controller;


import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController("/test")
public class TestController {

    @Autowired
    private RocketMQTemplate rocketMQTemplate;

    @GetMapping("/send")
    public String send(String topic, String tag, String msg) {
        rocketMQTemplate.convertAndSend(topic+":"+tag, msg);
        return "success";
    }
}
